home *** CD-ROM | disk | FTP | other *** search
- class classes.bro.BigLaser
- {
- var x;
- var y;
- var id;
- var dir;
- var clip;
- var axis;
- var w;
- var h;
- var exploX;
- var exploY;
- var xMov = 0;
- var yMov = 0;
- var power = 25;
- function BigLaser(px, py, pDir, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- this.dir = pDir;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("bigLaser","bigLaser" + this.id + "Clip",_root.d + 5000);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip.id = this.id;
- if(this.dir == "U")
- {
- this.axis = "y";
- this.yMov = -40;
- this.xMov = 0;
- this.y += 40;
- }
- else if(this.dir == "D")
- {
- this.axis = "y";
- this.yMov = 40;
- this.xMov = 0;
- this.y -= 40;
- }
- else if(this.dir == "R")
- {
- this.axis = "x";
- this.yMov = 0;
- this.xMov = 40;
- this.x -= 40;
- }
- else
- {
- this.axis = "x";
- this.yMov = 0;
- this.xMov = -40;
- this.x += 40;
- }
- this.clip.gotoAndStop(this.dir);
- this.w = this.clip._width;
- this.h = this.clip._height;
- _root.stats.fired = _root.stats.fired + 1;
- }
- function hit(pnum)
- {
- var _loc4_ = pnum;
- _root.createGunExplo([this.exploX,this.exploY,_root.randRange2(50,80)]);
- this.power -= _loc4_;
- var _loc3_ = 20 - this.power;
- if(_loc3_ < 1)
- {
- _loc3_ = 1;
- }
- this.clip.body.clip.gotoAndStop(_loc3_);
- if(this.power < 1)
- {
- _root.stats.hit = _root.stats.hit + 1;
- _root.removeBroShot("bigLaser" + this.id);
- }
- }
- function main()
- {
- this[this.axis + "Mov"] *= 1.03;
- if(this.x > 1075 || this.x < -75 || this.y > 675 || this.y < -75)
- {
- _root.removeBroShot("bigLaser" + this.id);
- }
- this.x += this.xMov;
- this.y += this.yMov;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-